package com.hxzy.front.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

import java.util.List;
import java.util.Map;

@Service
public class FontDictDataServiceImpl implements FontDictDataService{

    @Autowired
    private RestTemplate restTemplate;


    @Override
    public List selectByDictType(String dictType) {

        String url="http://localhost:10010/front/system/dict/data/type/"+dictType;

        Map  map=this.restTemplate.getForObject(url, Map.class);
        if(map.get("code").toString().equals("200")){
            List  listData= (List) map.get("data");
            return listData;
        }
        return null;
    }
}
